<%@ page contentType="text/html;charset=UTF-8" language="java" %>

<!DOCTYPE html>
<html lang="en">

<head>
  <meta charset="utf-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="width=device-width, initial-scale=1">
  <title>添加资讯</title>
  <meta name="description" content="一个充满童话世界的地方，带你回味童年." />
  <meta name="keywords" content="童话、英雄和魔法" />
  <link rel="shortcut icon" href="images/favicon.ico" />
  <!-- 引入我们自己的样式文件 -->
    <LINK href="css/content.css" type=text/css rel=stylesheet>
    <script>
        function check() {
            var a = document.getElementById("txt_Name6").value;
            var b = document.getElementById("txt_Name").value;
            var c = document.getElementById("txt_Name2").value;
            var d = document.getElementById("txt_Name4").value;
            var file = document.getElementById("news_picurl").value;
            if (a === "" || b === "" || c === "" || d === "") {
                alert("请填写完整！");
                return false;
            }
            if (file.length === 0 || file === "") {
                alert("请选择上传的文件！");
                return false;
            }
            return true;
        }
    </script>
</head>

<body>
<div style="padding-left:4px;">
    <table width="1200" border="0" cellpadding="0" cellspacing="0">
        <tr height="30">
            <td width="270" background="images/title01.jpg" class="title">&gt;&gt;资讯管理</td>
            <td width="30"><img src="images/title002.gif"/></td>
            <td width="534" bgcolor="#d9f0ff" class="txt">您的位置：后台管理 &gt; 资讯管理 &gt; 资讯信息</td>
        </tr>
    </table>
    <br/>
    <h3>添加资讯</h3>
    <form action="${pageContext.request.contextPath}/addNews" method="post" enctype="multipart/form-data"
          onsubmit="return check()">
        <table width="550" cellpadding="0" cellspacing="0" style="line-height:40px">
            <tr>
                <td align="right">资讯编号：</td>
                <td><input name="news_bianhao" type="text" id="txt_Name6"/>
                    *
                </td>
            </tr>
            <tr>
                <td width="177" align="right">资讯名称：</td>
                <td width="347"><input name="news_name" type="text" id="txt_Name"/>
                    *
                </td>
            </tr>
            <tr>
                <td align="right">发表时间：</td>
                <td><input name="news_time" type="text" id="txt_Name2"/>
                    *
                </td>
            </tr>
            <tr>
                <td align="right">资讯来源：</td>
                <td><input name="news_src" type="text" id="txt_Name4"/>
                    *
                </td>
            </tr>
            <tr>
                <td align="right">内&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;容：</td>
                <td><textarea name="news_content" id="txt_Code"></textarea>
                </td>
            </tr>
            <tr>
                <td align="right">图片文件:</td>
                <td><input type="file" id="news_picurl" name="picfile"/></td>
            </tr>
            <tr>
            <td>&nbsp;</td>
                <td>
                    <input id="btn_Save" value="保存" type="submit"/>
                    <input value="重置" type="reset" name="clear"/>
                    &nbsp;
                </td>
            </tr>
        </table>
    </form>
</div>
</body>

</html>